(if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
nil 'move)
(goto-char (match-beginning 0)))
- (if (and (bolp) (not (bobp)))
+ (if (and (bolp) (eobp) (not (bobp)))
(forward-char -1)))
(defun outline-next-heading ()
"Hide the body directly following this heading."
(interactive)
(outline-back-to-heading)
- (outline-end-of-heading)
(save-excursion
+ (outline-end-of-heading)
(outline-flag-region (point) (progn (outline-next-preface) (point)) t)))
(defun show-entry ()
(defun outline-show-heading ()
"Show the current heading and move to its end."
- (outline-flag-region (- (point)
- (if (bobp) 0
- (if (eq (char-before (1- (point))) ?\n)
- 2 1)))
+ (outline-flag-region (- (point) (if (bobp) 0 1))
(progn (outline-end-of-heading) (point))
nil))
(if (bolp)
(progn
;; Go to end of line before heading
- (forward-char -1)
- (if (bolp)
- ;; leave blank line before heading
- (forward-char -1))))))
+ (forward-char -1)))))
\f
(defun show-branches ()
"Show all subheadings of this heading, but not their bodies."
With argument, move up ARG levels.
If INVISIBLE-OK is non-nil, also consider invisible lines."
(interactive "p")
+ (and (eq this-command 'outline-up-heading)
+ (or (eq last-command 'outline-up-heading) (push-mark)))
(outline-back-to-heading invisible-ok)
(let ((start-level (funcall outline-level)))
(if (eq start-level 1)